using System.Collections.Generic;
using System.Text;

namespace OracleInternal.SqlAndPlsqlParser.LocalParsing
{
	internal class OracleLpExpression : OracleLpStatementElement
	{
		protected static IList<OracleLpExpression> s_cEmptyExpressionList = new List<OracleLpExpression>().AsReadOnly();

		protected IList<OracleLpExpression> m_vAllTerminalExpressions;

		protected OracleLpExpressionType m_vExpressionType;

		protected OracleLpExpression m_vParentExpression;

		protected OracleLpTextFragment m_vText;

		internal override OracleLpStatementElementType ElementType => OracleLpStatementElementType.Expression;

		public OracleLpExpressionType ExpressionType
		{
			get
			{
				return m_vExpressionType;
			}
			set
			{
				m_vExpressionType = value;
			}
		}

		public OracleLpExpression ParentExpression
		{
			get
			{
				return m_vParentExpression;
			}
			set
			{
				m_vParentExpression = value;
				base.Parent = value;
			}
		}

		public OracleLpTextFragment Text
		{
			get
			{
				return m_vText;
			}
			set
			{
				m_vText = value;
			}
		}

		public OracleLpExpression(OracleLpStatementElement parent)
			: base(parent)
		{
		}

		public virtual void EvaluateDatatype()
		{
		}

		public virtual IList<OracleLpExpression> GetAllTerminalExpressions()
		{
			return s_cEmptyExpressionList;
		}

		internal override void ToString(StringBuilder sb)
		{
			string depthIndent = base.DepthIndent;
			sb.Append(depthIndent);
			sb.Append("  ExprType: ");
			sb.Append(ExpressionType);
		}

		public override string ToString()
		{
			if (m_vText != null)
			{
				return m_vText.Fragment;
			}
			return null;
		}
	}
}
